package pers.zc.activiti.utils;

import java.util.UUID;

/**
 * @description uuid
 * @Author Lin FuYuan
 * @date 2020/6/15
 */
public class UuidUtils {
    public static String getUUID(){
        return UUID.randomUUID().toString().replace("-","");
    }

    public static Integer getUUIDInOrderId(){
        Integer orderId=UUID.randomUUID().toString().hashCode();
        orderId = orderId < 0 ? -orderId : orderId; //String.hashCode() 值会为空
        return orderId;
    }

    public static void main(String[] args){
        for (int i = 0; i<100; i++){
            System.out.println(UuidUtils.getUUIDInOrderId());
        }
    }
}
